﻿<Window x:Class="CSharp2.Capitulo08.Wpf.ServicosWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Serviços" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="486" Width="788" 
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        xmlns:userControls="clr-namespace:CSharp2.Capitulo08.Wpf.UserControls">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
    </Window.Resources>
    <Grid >
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF212121" Offset="0" />
                <GradientStop Color="#FFCEC9C9" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Label Content="Placa" Height="28" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label1" VerticalAlignment="Top" VerticalContentAlignment="Center" TabIndex="0" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="54,12,0,0" Name="placaTextBox" VerticalAlignment="Top" Width="120" TabIndex="1" IsReadOnly="False" VerticalContentAlignment="Center" />
        <Button Content="Pesquisar" Height="23" HorizontalAlignment="Left" Margin="180,12,0,0" Name="consultarPlacaButton" VerticalAlignment="Top" Width="75" TabIndex="2" IsDefault="True" Click="consultarPlacaButton_Click" />
        <Label Content="Modelo" Height="28" HorizontalAlignment="Left" Margin="261,10,0,0" Name="label2" VerticalAlignment="Top" VerticalContentAlignment="Center" />
        <Label Content="Cor" Height="28" HorizontalAlignment="Left" Margin="434,10,0,0" Name="label3" VerticalAlignment="Top" VerticalContentAlignment="Center" />
        <Label Content="Ano" Height="28" HorizontalAlignment="Left" Margin="585,10,0,0" Name="label4" VerticalAlignment="Top" VerticalContentAlignment="Center" />
        <TextBox Height="23" IsReadOnly="True" Margin="308,12,0,0" Name="textBox1" TabIndex="1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120" Text="{Binding Veiculo.Modelo.Descricao}" VerticalContentAlignment="Center" />
        <TextBox Height="23" HorizontalAlignment="Left" IsReadOnly="True" Margin="459,12,0,0" Name="textBox2" TabIndex="1" VerticalAlignment="Top" Width="120" Text="{Binding Veiculo.Cor.Descricao}" VerticalContentAlignment="Center" />
        <TextBox Height="23" HorizontalAlignment="Left" IsReadOnly="True" Margin="613,12,0,0" Name="textBox3" TabIndex="1" VerticalAlignment="Top" Width="120" Text="{Binding Veiculo.AnoModelo}" VerticalContentAlignment="Center" />
        <DataGrid Height="391" HorizontalAlignment="Left" Margin="10,44,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="723"
                  ItemsSource="{Binding Servicos}" AutoGenerateColumns="False" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Tipo" Binding="{Binding Path=TipoServico.Descricao}" MinWidth="100" />
                <DataGridTextColumn Header="Início" Binding="{Binding Path=DataInicio, StringFormat=\{0:d\}}" MinWidth="100" />
                <DataGridTextColumn Header="Fim" Binding="{Binding Path=DataFim, StringFormat=\{0:dd/MM/yyyy\}}" MinWidth="100" />
                <DataGridTextColumn Header="Valor" Binding="{Binding Path=Valor, StringFormat=\{0:c\}}" MinWidth="100" />
                <!--<DataGridTemplateColumn Header="Custo" MinWidth="100">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <userControls:UcSpinnerDotCircle Background="LightGray"  x:Name="aguardeUserControl" Visibility="{Binding Path=Custo.IsDirty, Converter={StaticResource BooleanToVisibility}}"/>
                            <Button Content="Consultar"  Click="consultarCustoButton_Click" Name="consultarCustoButton" />
                        </DataTemplate >
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>-->
                <DataGridTextColumn Header="Custo" Binding="{Binding Path=Custo, StringFormat=\{0:c\}}" MinWidth="100"  />
                <DataGridTextColumn Header="Sigla" Binding="{Binding Path=Sigla}" MinWidth="100"  />
            </DataGrid.Columns>
        </DataGrid>
        
    </Grid>
</Window>
